#pragma once

#include <iostream>
#include <string>
#include <cerrno>
#include <cassert>
#include <cstring>
#include <cerrno>

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

using namespace std;

#define NAMED_PIPE "/tmp/mypipe.chb"

bool createFifo(const string &path)
{
    umask(0);
    int ret = mkfifo(path.c_str(), 0666);
    if(ret == 0)
        return true;
    else if(ret == -1)
        cout << "error_no : " << errno << " err_msg : " << strerror(errno) << endl; 
}

void removeFifo(const char *path)
{
    int ret = unlink(path);
    assert(ret == 0);
    (void)ret;
}

